package Client;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;

import javax.swing.*;
import java.awt.event.*;

import javax.swing.plaf.basic.BasicButtonListener;

class ButtonListener implements ActionListener {

	public void actionPerformed(ActionEvent e) {
		JButton button = (JButton) e.getSource();
		String str = button.getText();
		DrawColumnHistogram ss = new DrawColumnHistogram();
		try {
			ss.shuzu(str);
		} catch (SQLException e1) {
			e1.printStackTrace();
		}
	}

}

public class GetNumberOfStudent extends JFrame {

	public void ss() {
		DrawColumnHistogram test = new DrawColumnHistogram();
		GetNumberOfTable a = new GetNumberOfTable();
		a.www();

		Font font = new Font("宋体", Font.BOLD, 12);
		super.setTitle("已词频统计的人数");
		setVisible(true);
		setSize(400, 300);
		JToolBar bar = new JToolBar();
		bar.setLayout(new GridLayout(10, 1));

		for (int i = 0; i < bianliang.Last; i++) {

			JButton newButton = new JButton(bianliang.map.get(i).toString());
			newButton.addActionListener(new ButtonListener());
			bar.add(newButton);
			add(bar, BorderLayout.CENTER);

		}

	}
}
